package com.jf.thread;

import java.util.Timer;
import java.util.TimerTask;

public class MyTimerTask extends TimerTask {
    private int count = 0;
    private Timer timer;
    public MyTimerTask(Timer timer){
        this.timer = timer;
    }


    @Override
    public void run() {
        System.out.println("我被执行了~！"+(++count));
//        timer.cancel();
    }
}
